#ifndef _BITSET_DEC
#define _BITSET_DEC

#include <bitset>

namespace mylib {
	template<size_t N> class Bitset : public std::bitset<N> {
	public:
		Bitset(unsigned long n ) : std::bitset<N>(n) {}
		Bitset &operator++(int){			// +1
			int i=0;
			for( ; i < N; i++ ) {
				if( !(*this)[i] )
					break;
				else
					(*this)[i]=0;
			}
			if( i < N )
				(*this)[i]=1;
			return *this;
		}
		Bitset &operator--(int) {
			int i=0;
			for(; i < N; i++ ) {
				if( (*this)[i] )
					break;
				else
					(*this)[i]=1;
			}
			if( i < N )
				(*this)[i]=0;
			return *this;
		}
	};
}
#endif
